package com.team1.supervend.domain;

public class SelectedItem {
	public int quantity;
	public ProductDescription description;
	
	public SelectedItem( ProductDescription desc, int quantity )
	{
		this.description = desc;
		this.quantity = quantity;
        // update inventory quantity level and belowMin flag for selected item -- This should elsewhere -- in the Inventory Update at vending items
		// here just for convenience now
		this.description.setQuantity( this.description.getQuantity() - quantity );
		this.description.setBelowMin();
		// end of what should be in inventory update
	}
	
	public PaymentAmount getSubtotal()
	{
		return description.getCost().times( quantity );
	}

}
